﻿<Window x:Class="SampleApp.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:wpfeVM="clr-namespace:WPFEdit.Views;assembly=WPFEdit.Controls"
        Title="SampleApp Editor" Height="639" Width="1177" Closing="WindowClosing">

    <Window.Resources>
        <DataTemplate  x:Key="TabTemplate">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding TabName}" />
                <Button
                    Command="{Binding CloseCommand}"
                    Content=" X "
                    Margin="5,0,1,0"
                    CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type TabItem}}, Path=DataContext}"
                    />
            </StackPanel>

        </DataTemplate>
    </Window.Resources>
    <DockPanel LastChildFill="True">
        <wpfeVM:MenuBar x:Name="MainWindowMenuBar" DockPanel.Dock="Top" DataContext="{Binding}" />
        <wpfeVM:DocumentTabView Name="MainWindowTabControl" ItemTemplate="{StaticResource TabTemplate}">

        </wpfeVM:DocumentTabView>

    </DockPanel>
</Window>
